package com.thanh.icook;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class MainmenuActivity extends Activity {
	private ProgressDialog progressDialog;
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_menumain);
        setmenu();
    }
    
    private void setmenu() {
    	ImageView btn_thucdon = (ImageView)findViewById(R.id.imageButton1);
    	btn_thucdon.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				progressDialog = ProgressDialog.show(MainmenuActivity.this, "", 
						getResources().getString(R.string.loading), true);
				new Thread(){
					public void run() {
						startActivity(new Intent(MainmenuActivity.this, ThucdonActivity.class));
						progressDialog.dismiss();
					}
				}.start();
				
			}
		});
    	
    	ImageView btn_quanly = (ImageView)findViewById(R.id.imageButton3);
    	btn_quanly.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				progressDialog = ProgressDialog.show(MainmenuActivity.this, "", 
						getResources().getString(R.string.loading), true);
				new Thread(){
					public void run() {
						startActivity(new Intent(MainmenuActivity.this, QuanLyActivity.class));
						progressDialog.dismiss();
					}
				}.start();
				
			}
		});
    	
    	ImageView btn_dicho = (ImageView)findViewById(R.id.imageButton2);
    	btn_dicho.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				//startActivity(new Intent(MainmenuActivity.this, .class));
			}
		});
	}
}